<!--回弹检测结果管控——1 -->
<template>
  <div class="department">
    <!-- 左侧部门管理 -->
    <div class="structureTree" v-if="treelength">
      <div class="structureTree_title">
        <div>组织机构</div>
        <div>
          <el-checkbox v-model="checked" @change="see()">查看下级</el-checkbox>
        </div>
      </div>

      <tree :treeData="treeData" :checkData="checkData" name="engineerList" nodeKey="fCompanyid"
        @getTreeInfo="handleNodeClick" :defaultProps="defaultProps">
      </tree>
    </div>

    <!-- 右侧 -->
    <div class="department_right">
      <!-- 部门信息 -->
      <el-breadcrumb :title="name"></el-breadcrumb>
      <!-- 顶部导航栏 -->
      <div class="mechanism_nav">
        <!-- 左侧 -->
        <div class="mechanism_nav_left">
          <div class="mechanism_nav_left">
            <input type="text" placeholder="请输入关键字" v-model="getList.keyWord" />
            <el-button type="primary" icon="el-icon-search" size="small" @click="getDataList(getList)">查询</el-button>

            <el-select @change="function (v) {
              return selectJudgetype(v);
            }
              " v-model="getList.keyType" placeholder="请选择检测类型">
              <el-option v-for="v in Checktype" :key="v.fItemName" :label="v.fItemName" :value="v">
              </el-option>
            </el-select>
          </div>
        </div>
        <!-- 右侧 -->
        <div class="print">
          <div class="printTable">
            <!--  -->
            <el-button type="primary" icon="el-icon-refresh" size="small" @click="getDataList(getList)">
            </el-button>
            <el-button type="primary" v-if="yj_view" icon="el-icon-search" size="small"
              @click="openDialog(equipmentDetailId, 4)">查看
            </el-button>
          </div>
        </div>
      </div>

      <!-- 表格 -->
      <div class="text_table">
        <el-table ref="multipleTableA" v-loading="loading" element-loading-text="拼命加载中"
          element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.2)"
          @row-click="getRowInfo" :data="tableData" style="width: 100%"
          :height="navigatepageNums > 1 ? 'calc(100% - 50px)' : '100%'" stripe border highlight-current-row
          @current-change="rowChange">
          <el-table-column fixed type="index" label="序号" width="50" align="center">
          </el-table-column>
          <el-table-column prop="fProjectname" label="建设项目简称" width="170">
            <!-- 超出鼠标滑过显示 -->
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fProjectname">{{
                  scope.row.fProjectname
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fChecktype" label="检测类型" width="93">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fChecktype">{{
                  scope.row.fChecktype
                }}</a>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="fCheckcompanyname" label="检测单位" width="120">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fLeadercompanyname">{{
                  scope.row.fLeadercompanyname
                }}</a>
              </div>
            </template>
          </el-table-column>

          <el-table-column prop="fClientname" label="施工/委托单位" width="120">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fCompanyname">{{
                  scope.row.fCompanyname
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fReportno" align="center" label="报告编号" width="170">
            <template slot-scope="scope">
              <el-button @click="openDialog(scope.row, 1)" @cell-dblclick="openDialog" type="text" size="small"
                style="padding: 0 !important; margin: 0">
                {{ scope.row.fReportno }}
              </el-button>
            </template>
          </el-table-column>
          <el-table-column prop="fFactoryname" align="center" label="报告日期" width="90">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fReportdates">{{
                  scope.row.fReportdates
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fSamplenumber" label="样品编号" width="160" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fSamplingno">{{
                  scope.row.fSamplingno
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fRecordnumber" label="记录编号" width="160" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fMarkno">{{
                  scope.row.fMarkno
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fOutdates" label="工程部位/用途" width="100" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fProjecttypename">{{
                  scope.row.fProjecttypename
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fCheckdates" label="试验检测日期" width="90" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fTestdates">{{
                  scope.row.fTestdates
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fCheckreference" label="检测依据" width="120" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fTestnote">{{
                  scope.row.fTestnote
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fDecidereference" label="判定依据" width="120" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fJudgetype">{{
                  scope.row.fJudgetype
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column prop="fCreateusername" label="记录人" width="60" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fCreateusername">{{
                  scope.row.fCreateusername
                }}</a>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="记录表" width="60" align="center">
            <template slot-scope="scope">
              <el-button @click="openDialog(scope.row, 2)" @cell-dblclick="openDialogs" type="text" size="small"
                style="padding: 0 !important; margin: 0">
                记录表
              </el-button>
            </template>
          </el-table-column>
          <el-table-column prop="fNote" label="报告" width="50">
            <template slot-scope="scope">
              <el-button @click="openDialog(scope.row, 3)" @cell-dblclick="openDialogs" type="text" size="small"
                style="padding: 0 !important; margin: 0">
                报告
              </el-button>
            </template>
          </el-table-column>

          <el-table-column prop="fDecidereference" label="信息状态" width="80" align="center">
            <template slot-scope="scope">
              <div class="lineBoxhidden">
                <a href="javascript:;" :title="scope.row.fStatus">{{
                  scope.row.fStatus
                }}</a>
              </div>
            </template>
          </el-table-column>
          <template slot="empty">
            <img style="width: 285px; height: 208px" src="@/assets/img/undata.png" alt="" />
            <div class="pageFlagText">暂时没有数据哦！</div>
          </template>
        </el-table>
        <div class="block" v-if="navigatepageNums > 1">
          <!--  -->
          <div class="paginationInfo">
            检索到{{ queryCriteriaData.total }} 条记录 | 显示第
            <span v-if="getList.page == 1">{{ getList.page }}</span><span v-else>{{ 20 * (getList.page - 1) }}</span>
            -

            <span v-if="queryCriteriaData.pages == queryCriteriaData.lastPage">
              {{ queryCriteriaData.total }}</span>
            <span v-else> {{ 20 * getList.page }} </span>
            条记录
            <!-- - {{ 20 * getList.page }} 条记录 -->
          </div>

          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
            :current-page="getList.page" :page-size="getList.pageSize" layout="prev, pager, next, jumper"
            :total="queryCriteriaData.total">
          </el-pagination>
          <!-- :info="queryCriteriaData" -->
        </div>
      </div>
    </div>
    <!-- 查看弹框 -->
    <!-- 按检测记录新增/编辑 -->
    <div class="steelSheet Control-1">
      <el-dialog :close-on-click-modal="false" :title="dialogText" v-dialogDrag :visible.sync="dialogTableVisible"
        v-loading="loadingDialog" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading"
        element-loading-background="rgba(0, 0, 0, 0.2)">
        <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
          <el-menu-item index="1">混凝土回弹检测记录表</el-menu-item>
          <el-menu-item index="2">混凝土回弹检测报告</el-menu-item>
        </el-menu>
        <div v-show="activeIndex == 1" class="dialogBody common" :style="{ height: dialogHeights }">
          <header>
            现场混凝土强度检测记录表(回弹法)
            <div class="printTable">
              <el-button type="primary" icon="el-icon-printer" size="small" @click="Print(1)">打印表格
              </el-button>
            </div>
          </header>

          <div class="top_box top_1" style="border-bottom: 1px solid #ccc" id="checkForm1">
            <div class="bottom1_1" style="background: #f5f7fa">检测类型：</div>
            <div class="bottom1_2" ref="fChecktype">
              <el-input disabled v-model="formData.fChecktype" placeholder="/"></el-input>
            </div>
          </div>
          <!-- 头部 -->
          <div class="title">
            <div class="title_Name title_record">
              <div class="title_input_text">检测单位名称：</div>
              <div class="title_input_con" v-text="formData.fLeadercompanyfullname"></div>
            </div>
            <div class="title_input">
              <div class="title_input_text">记录编号：</div>
              <div class="title_input_con">{{ formData.fMarkno }}</div>
              <!-- <div class="title_input_con"  >{{fMarkno}}</div> -->
            </div>
          </div>
          <!-- 工程名称 -->
          <div class="top_box top_1">
            <div class="bottom1_1" style="background: #f5f7fa">工程名称</div>
            <div class="bottom1_2">
              <el-input disabled v-model="formData.fProjectfullname" placeholder="/"></el-input>
            </div>
          </div>
          <!-- @change="function(item){ return TestnoteSelectId(item)}" -->
          <!-- 工程部位/用途 -->
          <div class="top_box top_1">
            <div class="bottom1_1">工程部位/用途</div>

            <div class="bottom1_2" ref="fProjecttypename">
              <el-input disabled v-model="formData.fProjecttypename" placeholder="/"></el-input>
            </div>
          </div>

          <!-- 样品信息 -->
          <div class="top_box top_1">
            <div class="bottom1_1">样品信息</div>
            <div class="bottom1_2" ref="fSamplename" style="background-color: #f5f7fa">
              <el-input v-model="sample" placeholder="/" disabled></el-input>
            </div>
          </div>
          <!--  -->
          <!-- 试验检测日期 -->
          <div class="top_box top_1">
            <div class="top_4">
              <div class="bottom1_1">试验检测日期</div>
              <div class="bottom1_2" ref="fTestdates">
                <el-input disabled v-model="formData.fTestdates" placeholder="/"></el-input>
              </div>
            </div>
            <div class="top_4">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                试验条件
              </div>
              <div class="bottom1_2" ref="fTesttype">
                <el-input disabled v-model="formData.fTesttype" placeholder="/"></el-input>
              </div>
            </div>
          </div>
          <!-- 检测依据 -->
          <div class="top_box top_1">
            <div class="top_4">
              <div class="bottom1_1">检测依据</div>
              <div class="bottom1_2" ref="fTestnote">
                <el-input v-model="formData.fTestnote" disabled placeholder="/"></el-input>
              </div>
            </div>
            <div class="top_4">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                判定依据
              </div>
              <div class="bottom1_2" ref="fJudgetype">
                <el-input v-model="formData.fJudgetype" disabled placeholder="/"></el-input>
              </div>
            </div>
          </div>
          <!-- 主要仪器设备名称及编号 -->
          <div class="top_box top_1 top_2 hhgy hgjk">
            <div class="bottom1_1">主要仪器设备<br />名称及编号</div>
            <!-- <div class="bottom1_2" style="background-color: #f5f7fa" @click="equipment()">
                <el-input v-model="formData.fEquipmentname" placeholder="/" disabled></el-input>
                                                                                                </div> -->
            <!-- collapse-tags -->
            <!--  -->
            <div class="bottom1_2" ref="fEquipmentname">
              <el-input v-model="fEquipmentname" disabled placeholder="/"></el-input>
            </div>
          </div>
          <!-- 钢筋工称直径 -->
          <div class="top_box top_1">
            <div class="top_4 top_3">
              <div class="bottom1_1">测区强度换算表</div>
              <div class="bottom1_2 selectCenter" ref="fConcretetype">
                <el-input v-model="formData.fConcretetype" disabled placeholder="/"></el-input>
              </div>
            </div>
            <div class="top_4 top_3">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                实测数量(测区)
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fTestnum" placeholder="/" class="center_text"></el-input>
              </div>
            </div>
          </div>
          <!-- 报告编号 -->
          <div class="top_box top_1">
            <div class="top_4 top_3">
              <div class="bottom1_1">回弹测试方向</div>
              <div class="bottom1_2 selectCenter" ref="fDirection">
                <el-input v-model="formData.fDirection" disabled placeholder="/"></el-input>
              </div>
            </div>
            <div class="top_4 top_3">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                标准差S(MPa)
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fStandarddeviation" placeholder="/" class="center_text">
                </el-input>
              </div>
            </div>
          </div>
          <!-- 构件名称 -->
          <div class="top_box top_1">
            <div class="top_4 top_3">
              <div class="bottom1_1">检测浇筑面</div>
              <div class="bottom1_2 selectCenter" ref="fSurface" style="text-align: center">
                <el-input v-model="formData.fSurface" disabled placeholder="/"></el-input>
              </div>
            </div>
            <div class="top_4 top_3">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                混凝土强度推定值(MPa)
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fConcreteresult" placeholder="/" class="center_text"></el-input>
              </div>
            </div>
          </div>

          <!-- 表格 -->
          <div class="table_recordSheetf">
            <!-- 左侧数据1-20 -->
            <div class="recordSheet" style="width: 100%; box-sizing: border-box">
              <el-table style="width: 100%; box-sizing: border-box">
                <el-table-column label="测区" width="48"> </el-table-column>
                <el-table-column label="各测点实测回弹值Ni">
                  <el-table-column label="1" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="2" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="3" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="4" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="5" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="6" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="7" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="8" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="9" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="10" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="11" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="12" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="13" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="14" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="15" :width="widthTab">
                  </el-table-column>
                  <el-table-column label="16" :width="widthTab">
                  </el-table-column>
                </el-table-column>
              </el-table>
              <div class="recordSheet_boxf" v-for="(v, i) in formData.checkConcretesampleitems" :key="i">
                <div class="recordSheet_box_1f row1_2" style="color: #676d77; font-size: 12px">
                  <!-- {{i+1}} -->
                  <el-input v-model="v.fOrder" placeholder="/" disabled class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2" ref="focus">
                  <el-input ref="fParam1" disabled v-model="v.fParam1" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_3">
                  <el-input ref="fParam2" disabled v-model="v.fParam2" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_4">
                  <el-input ref="fParam3" disabled v-model="v.fParam3" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_5">
                  <el-input ref="fParam4" disabled v-model="v.fParam4" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2">
                  <el-input ref="fParam5" disabled v-model="v.fParam5" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2">
                  <el-input ref="fParam6" disabled v-model="v.fParam6" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_3">
                  <el-input ref="fParam7" disabled v-model="v.fParam7" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_4">
                  <el-input ref="fParam8" disabled v-model="v.fParam8" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_5">
                  <el-input ref="fParam9" disabled v-model="v.fParam9" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2">
                  <el-input ref="fParam10" disabled v-model="v.fParam10" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2">
                  <el-input ref="fParam11" disabled v-model="v.fParam11" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_3">
                  <el-input ref="fParam12" disabled v-model="v.fParam12" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_4">
                  <el-input ref="fParam13" disabled v-model="v.fParam13" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_5">
                  <el-input ref="fParam14" disabled v-model="v.fParam14" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2">
                  <el-input ref="fParam15" disabled v-model="v.fParam15" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3f row1_2">
                  <el-input ref="fParam16" disabled v-model="v.fParam16" placeholder="/" class="center_text"></el-input>
                </div>
              </div>
            </div>
          </div>
          <!-- 表二 -->
          <div class="table_recordSheetfv" id="steelSheet">
            <!-- 左侧数据1-20 -->
            <div class="recordSheet" style="width: 100%; box-sizing: border-box">
              <el-table style="width: 100%; box-sizing: border-box">
                <el-table-column label="测区" width="158"> </el-table-column>
                <el-table-column label="1" :width="widthTab1">
                </el-table-column>
                <el-table-column label="2" :width="widthTab1">
                </el-table-column>
                <el-table-column label="3" :width="widthTab1">
                </el-table-column>
                <el-table-column label="4" :width="widthTab1">
                </el-table-column>
                <el-table-column label="5" :width="widthTab1">
                </el-table-column>
                <el-table-column label="6" :width="widthTab1">
                </el-table-column>
                <el-table-column label="7" :width="widthTab1">
                </el-table-column>
                <el-table-column label="8" :width="widthTab1">
                </el-table-column>
                <el-table-column label="9" :width="widthTab1">
                </el-table-column>
                <el-table-column label="10" :width="widthTab1">
                </el-table-column>
              </el-table>
              <div class="recordSheet_boxf" v-for="(v, i) in formData.checkConcretesampleresult" :key="i">
                <div class="recordSheet_box_1fv row1_2" style="color: #676d77; font-size: 12px">
                  <el-input v-model="v.fNote" placeholder="/" disabled class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult1" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_3">
                  <el-input disabled v-model="v.fResult2" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_4">
                  <el-input disabled v-model="v.fResult3" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_5">
                  <el-input disabled v-model="v.fResult4" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult5" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult6" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_3">
                  <el-input disabled v-model="v.fResult7" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_4">
                  <el-input disabled v-model="v.fResult8" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_5">
                  <el-input disabled v-model="v.fResult9" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult10" placeholder="/" class="center_text"></el-input>
                </div>
              </div>
            </div>
          </div>

          <!-- 附加声明 -->
          <div class="bottom_box box2">
            <div class="bottom1_1">附加声明</div>
            <div class="bottom1_2">
              <el-input disabled v-model="formData.fNote"></el-input>
            </div>
          </div>
          <!-- 监理 -->
          <!-- <div class="bottom_box box3">
              <div class="bottom1_1">监理</div>
              <div class="bottom1_2"></div>
                                                                                              </div> -->
        </div>
        <!-- 钢筋保护层厚度试验检测报告 -->
        <div v-show="activeIndex == 2" class="dialogBody common reportSheet" :style="{ height: dialogHeights }">
          <header>
            现场混凝土强度检测报告
            <div class="printTable">
              <el-button type="primary" icon="el-icon-printer" size="small" @click="Print(2)">打印表格
              </el-button>
            </div>
          </header>
          <!-- 头部 -->
          <div class="title">
            <div class="title_Name">
              <div class="title_input_text">检测单位名称(专用章):</div>
              <div class="title_input_con" v-text="formData.fLeadercompanyfullname"></div>
            </div>
            <div class="title_input">
              <div class="title_input_text">报告编号：</div>
              <div class="title_input_con" v-text="formData.fReportno"></div>
            </div>
          </div>
          <!-- 施工/委托单位 -->
          <div class="top_box top_1 top_boxh" style="height: 50px !important; line-height: 50px">
            <div class="top_4" style="height: 50px !important; line-height: 50px !important">
              <div class="bottom1_1" style="line-height: 50px !important">
                施工/委托单位
              </div>
              <div class="bottom1_2" style="display: flex; word-break: break-all">
                {{ formData.fCompanyfullname }}
              </div>
            </div>
            <div class="top_4">
              <div class="bottom1_1" style="
                  border-left: 1px solid #ccc;
                  line-height: 50px !important;
                ">
                工程名称
              </div>
              <div class="bottom1_2">{{ formData.fProjectfullname }}</div>
            </div>
          </div>
          <!-- 工程部位/用途 -->
          <div class="top_box top_1 top_boxh">
            <div class="bottom1_1">工程部位/用途</div>
            <div class="bottom1_2 hbhg" ref="fProjecttypename1" style="padding: 0 !important ">
              <el-input disabled v-model="formData.fProjecttypename" placeholder="/"></el-input>
            </div>
          </div>
          <!-- 样品信息 -->
          <div class="top_box top_1 top_boxh">
            <div class="bottom1_1">样品信息</div>
            <div class="bottom1_2" ref="fSamplename1" style="background-color: #f5f7fa">
              <el-input v-model="sample" placeholder="/" disabled></el-input>
            </div>
          </div>
          <div class="top_box top_1 top_boxh">
            <div class="top_4">
              <div class="bottom1_1">报告日期</div>
              <div class="bottom1_2" ref="fReportdates">
                <el-input v-model="formData.fReportdates" placeholder="/" disabled></el-input>
              </div>
            </div>
            <div class="top_4">
              <div class="bottom1_1">是否合格</div>
              <div class="bottom1_2" ref="fIstrue">
                <el-input v-model="formData.fIstrue" placeholder="/" disabled></el-input>
              </div>
            </div>
          </div>

          <!-- 检测依据 -->
          <div class="top_box top_1 top_boxh">
            <div class="top_4">
              <div class="bottom1_1">检测依据</div>
              <div class="bottom1_2" ref="fTestnote1">
                <el-input v-model="formData.fTestnote" placeholder="/" disabled></el-input>
              </div>
            </div>
            <div class="top_4">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                判定依据
              </div>
              <div class="bottom1_2" ref="fJudgetype1">
                <el-input v-model="formData.fJudgetype" placeholder="/" disabled></el-input>
              </div>
            </div>
          </div>
          <!-- 主要仪器设备名称及编号 -->
          <div class="top_box top_1 top_2">
            <div class="bottom1_1">主要仪器设备<br />名称及编号</div>
            <div class="bottom1_2" ref="fEquipmentname1">
              <el-input v-model="fEquipmentname" placeholder="/" disabled></el-input>
            </div>
          </div>
          <!-- 龄期 -->
          <div class="top_box top_1 top_boxh">
            <div class="top_4">
              <div class="bottom1_1">龄期(d)</div>
              <div class="bottom1_2" ref="fSpecimenage">
                <el-input disabled v-model="formData.fSpecimenage" placeholder="/">
                </el-input>
              </div>
            </div>
            <div class="top_4">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                设计强度等级
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fConcretelevel" placeholder="/"></el-input>
              </div>
            </div>
          </div>

          <!-- 钢筋工称直径 -->
          <div class="top_box top_1 top_boxh">
            <div class="top_4 top_3">
              <div class="bottom1_1">测区强度换算表</div>
              <div class="bottom1_2 selectCenter" ref="fConcretetype1">
                <el-input v-model="formData.fConcretetype" placeholder="/" disabled></el-input>
              </div>
            </div>
            <div class="top_4 top_3">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                实测数量(测区)
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fTestnum" placeholder="/" class="center_text"></el-input>
              </div>
            </div>
          </div>
          <!-- 报告编号 -->
          <div class="top_box top_1 top_boxh">
            <div class="top_4 top_3">
              <div class="bottom1_1">回弹测试方向</div>
              <div class="bottom1_2 selectCenter" ref="fDirection1">
                <el-input v-model="formData.fDirection" placeholder="/" disabled></el-input>
              </div>
            </div>
            <div class="top_4 top_3">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                标准差S(MPa)
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fStandarddeviation" placeholder="/" class="center_text">
                </el-input>
              </div>
            </div>
          </div>
          <!-- 构件名称 -->
          <div class="top_box top_1 top_boxh">
            <div class="top_4 top_3">
              <div class="bottom1_1">检测浇筑面</div>
              <div class="bottom1_2 selectCenter" ref="fSurface1">
                <el-input v-model="formData.fSurface" placeholder="/" disabled></el-input>
              </div>
            </div>
            <div class="top_4 top_3">
              <div class="bottom1_1" style="border-left: 1px solid #ccc">
                混凝土强度推定值(MPa)
              </div>
              <div class="bottom1_2">
                <el-input disabled v-model="formData.fConcreteresult" placeholder="/" class="center_text"></el-input>
              </div>
            </div>
          </div>
          <!-- 表格 -->
          <div class="table_recordSheetfvs table369">
            <!-- 左侧数据1-20 -->
            <div class="recordSheet" style="width: 100%; box-sizing: border-box">
              <el-table style="width: 100%; box-sizing: border-box">
                <el-table-column label="测区" width="158"> </el-table-column>
                <el-table-column label="1" :width="widthTab1">
                </el-table-column>
                <el-table-column label="2" :width="widthTab1">
                </el-table-column>
                <el-table-column label="3" :width="widthTab1">
                </el-table-column>
                <el-table-column label="4" :width="widthTab1">
                </el-table-column>
                <el-table-column label="5" :width="widthTab1">
                </el-table-column>
                <el-table-column label="6" :width="widthTab1">
                </el-table-column>
                <el-table-column label="7" :width="widthTab1">
                </el-table-column>
                <el-table-column label="8" :width="widthTab1">
                </el-table-column>
                <el-table-column label="9" :width="widthTab1">
                </el-table-column>
                <el-table-column label="10" :width="widthTab1">
                </el-table-column>
                <el-table-column label="11" :width="widthTab1">
                </el-table-column>
              </el-table>
              <div class="recordSheet_box" v-for="(v, i) in formData.checkConcretesampleresult" :key="i">
                <div class="recordSheet_box_1fvs row1_2" style="color: #676d77; font-size: 12px">
                  <!-- {{i+1}} -->
                  <el-input v-model="v.fNote" placeholder="/" disabled class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult1" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_3">
                  <el-input disabled v-model="v.fResult2" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_4">
                  <el-input disabled v-model="v.fResult3" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_5">
                  <el-input disabled v-model="v.fResult4" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult5" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult6" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_3">
                  <el-input disabled v-model="v.fResult7" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_4">
                  <el-input disabled v-model="v.fResult8" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_5">
                  <el-input disabled v-model="v.fResult9" placeholder="/" class="center_text"></el-input>
                </div>
                <div class="recordSheet_box_3fv row1_2">
                  <el-input disabled v-model="v.fResult10" placeholder="/" class="center_text"></el-input>
                </div>
              </div>
            </div>
          </div>
          <!--底部 第一行 -->

          <!-- 检测结论 -->
          <div class="bottom_box box2">
            <div class="bottom1_1">检测结论</div>
            <div class="bottom1_2" ref="fTestresult">
              <!-- <el-input v-model="formData.fTestresult"></el-input> -->
              <el-input v-model="formData.fTestresult" placeholder="/" disabled></el-input>
            </div>
          </div>
          <!-- 附加声明 -->
          <div class="bottom_box box2">
            <div class="bottom1_1">附加声明</div>
            <div class="bottom1_2">
              <el-input v-model="formData.fNote"></el-input>
            </div>
          </div>
          <!-- 监理意见及签字 -->
          <!-- <div class="bottom_box box3 top_boxh">
              <div class="bottom1_1">监理意见及签字</div>
              <div class="bottom1_2">
                <el-input v-model="supervisor"></el-input>
              </div>
                                                                                              </div> -->
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import tree from "@/components/public/common-trees";

import {
  getUserCompanyTreeList,
  getConcreteChecksampleByFid,
  getConcreteChecksamplePageList, //// 回弹检测结果管控-1列表
  saveConcreteChecksample,
} from "@/api/request.js";
// el-breadcrumb
import elBreadcrumb from "@/components/public/el-breadcrumb.vue";
export default {
  inject: ["reload"],
  name: "Home",
  data() {
    return {
      names: "Control-1",
      yj_view: null,
      yj_record: null,
      yj_report: null,
      widthTab: "55",
      widthTab1: "77",
      Checktype: [
        {
          fItemName: "==请选择==",
          fItemValue: "==请选择==",
        },
        {
          fItemName: "施工单位自检",
          fItemValue: "施工单位自检",
        },
        {
          fItemName: "监理单位抽检",
          fItemValue: "监理单位抽检",
        },
        {
          fItemName: "中试单位抽检",
          fItemValue: "中试单位抽检",
        },
      ], //检测类型 - 根据当前登录用户获取检测类型
      concretetypeList: [], //泵送混凝土
      concretetypeunList: [], //非泵送混凝土
      fEquipmentname: [], //已选主要仪器设备
      dialogHeights: null,
      dialogText: "",
      // 列表
      getList: {
        modelType: "2", // 0代办 1已办  2查询页面
        fCompanyid: null, //机构id
        fUserid: null, //当前登录用户id
        sublevel: "1", //查看下级  1是0否
        keyType: "", //检测类型
        keyWord: "", //样品编号模糊查询字段
        page: 1, //页码
        pageSize: 20, //每页条数
      },
      equipmentDetailId: null, //列表页id
      navigatepageNums: null, //是否显示分页
      queryCriteriaData: {},
      formData: {},
      sample: "",
      checked: true, //查看下级
      name: "未选择公司",
      dialogHeight: "",
      activeIndex: "1",
      fId: null, //当前数据fId
      loading: false,
      dialogTableVisible: false,
      formLabelWidth: "70px",
      treeData: [],
      tableData: [],
      // 左侧机构树
      defaultProps: {
        children: "children",
        label: "fShortname",
      },
      companyId: null,
      loadingDialog: false,
      currentRowId: "",
      treelength: false,
      treeText: {
        companyId: null,
        userId: null,
      },
      highlightBd: true, //左侧机构树停留背景色
      checkData: [], //选中tree状态id
      thedHederShow: false,
    };
  },
  components: {
    elBreadcrumb,
    tree,
  },
  created() {
    this.concretetypeList = JSON.parse(
      sessionStorage.getItem("concretetypeList")
    ); //泵送混凝土
    this.concretetypeunList = JSON.parse(
      sessionStorage.getItem("concretetypeunList")
    ); //非泵送混凝土
  },
  mounted() {
    this.userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
    this.getList.fUserid = this.userInfo.userId;
    if (JSON.parse(sessionStorage.getItem("engineerList"))) {
      var id = JSON.parse(sessionStorage.getItem("engineerList"));
      this.checkData = [id.fCompanyid];
    }

    this.getHeight();
    this.getTree();
    this.btnRole(this.names);
  },
  methods: {
    Print(num) {
      if (num == 1) {
        window.open(
          "http://1.14.19.236:8054/concreteScreen/App/upload/getExcelByConcreteSample.do?fId=" +
          this.equipmentDetailId
        );
      } else if (num == 2) {
        window.open(
          "http://1.14.19.236:8054/concreteScreen/App/upload/getExcelByConcreteSampleCode.do?fId=" +
          this.equipmentDetailId
        );
      }
    },
    btnRole(name) {
      var btnList = [];
      var ModuleList = JSON.parse(sessionStorage.getItem("ModuleList"));
      if (ModuleList.length > 0) {
        ModuleList.map((item) => {
          if (item.fEncode == name) {
            btnList = item.modulebuttonList;
          }
        });
        var btnStr = [];
        btnList.map((item) => {
          console.log(item);
          btnStr.push(item.fEncode);
        });

        this.yj_view = btnStr.includes("yj_view");
        this.yj_record = btnStr.includes("yj_record");
        this.yj_report = btnStr.includes("yj_report");
      } else {
        this.yj_view = true;
        this.yj_record = true;
        this.yj_report = true;
      }
    },
    openDialogs(data, num) {
      if (num == 1) {
        window.open(
          "http://1.14.19.236:8054/concreteScreen/App/upload/getExcelByConcreteSample.do?fId=" +
          data.fId
        );
      } else if (num == 2) {
        window.open(
          "http://1.14.19.236:8054/concreteScreen/App/upload/getExcelByConcreteSampleCode.do?fId=" +
          data.fId
        );
      }
    },
    // 页面切换
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      this.getList.page = val;
      this.getDataList(this.getList);
    },
    selectJudgetype(e) {
      if (e.fItemName == "==请选择==") {
        this.getList.keyType = "";
      } else {
        this.getList.keyType = e.fItemName;
      }
      this.getDataList(this.getList);
    },
    //查看下级
    see() {
      if (this.checked == true) {
        this.getList.sublevel = 1;
      } else {
        this.getList.sublevel = 0;
      }
      this.getDataList(this.getList);
    },
    // 点击当前行变色
    rowChange(val) {
      this.currentRow = val;
    },
    getDetail() {
      if (this.equipmentDetailId != null && this.equipmentDetailId != "") {
        this.edit(1);
      } else {
        return this.$message.error("请先选择需要编辑的数据");
      }
    },
    edit() {
      if (this.equipmentDetailId != null && this.equipmentDetailId != "") {
        this.dialogText = "查看";
        this.dialogTableVisible = true;
        this.loadingDialog = true;
        getConcreteChecksampleByFid({ fId: this.equipmentDetailId })
          .then((res) => {
            console.log(res);
            if (res.errcode == 0) {
              var that = this;
              that.loadingDialog = false;
              that.formData = res.data.lrCheckConcretesample;

              that.sample =
                "样品名称:" +
                that.formData.fSamplename +
                "; " +
                "样品编号:" +
                that.formData.fSamplingno +
                "; " +
                "样品状态:" +
                that.formData.fSamplespecs +
                "; ";
              this.fEquipmentname = this.formData.fEquipmentname;
              // this.fEquipmentname
              var data =
                res.data.lrCheckConcretesample.checkConcretesampleitems;
              var table =
                res.data.lrCheckConcretesample.checkConcretesampleresult;
              var totalData = [];
              var checkname = [
                "fParam1",
                "fParam2",
                "fParam3",
                "fParam4",
                "fParam5",
                "fParam6",
                "fParam7",
                "fParam8",
                "fParam9",
                "fParam10",
                "fParam11",
                "fParam12",
                "fParam13",
                "fParam14",
                "fParam15",
                "fParam16",
              ];
              var alreadyData = []; //已填的测区
              for (var i = 0; i < data.length; i++) {
                for (var j = 0; j < checkname.length; j++) {
                  totalData.push(data[i].fId);
                  if (data[i][checkname[j]] != "") {
                    alreadyData.push(data[i].fId);
                  }
                }
              }
              var totalId = []; //所有测区Id
              data.map((item) => {
                totalId.push(item.fId);
              });
              var totalIdIndex = []; //已填测区 index
              totalId.map((item, index) => {
                alreadyData.map((i) => {
                  if (item == i) {
                    totalIdIndex.push(index);
                  }
                });
              });
              let newData = alreadyData.filter(
                (item, index) => alreadyData.indexOf(item) === index
              );
              this.formData.fTestnum = newData.length; // 实测数量(测区)
              // this.selecttTotalIdIndex = totalIdIndex; //已填测区 index
              var blankData = [];
              var rowData = []; //所有数据，不填补零
              var realArr = []; //每行真实数据
              for (var c = 0; c < data.length; c++) {
                var rowDeatil = [];
                var realData = []; //真实数据
                for (var h = 0; h < checkname.length; h++) {
                  if (data[c][checkname[h]] != "") {
                    rowDeatil.push(data[c][checkname[h]]);
                    realData.push(data[c][checkname[h]]);
                  } else {
                    blankData.push(c);
                    rowDeatil.push("0");
                    // realData.push('0')
                  }
                }

                rowData.push({
                  data: rowDeatil,
                });
                realArr.push({
                  data: realData,
                });
              }
              // 10个数，去掉三个最大数和三个最小数
              var drawData = []; // 10个数，去掉三个最大数和三个最小数
              for (var s = 0; s < realArr.length; s++) {
                // // 数组对象排序
                if (realArr[s].data.length == 16) {
                  var sortData = realArr[s].data.sort(function (a, b) {
                    return a - b;
                  });
                  drawData.push({
                    data: sortData.slice(3, 13),
                  });
                } else {
                  drawData.push({
                    data: realArr[s].data,
                  });
                }
              }
              var angleNum = []; // 四舍五入
              var anglerealNum = []; //实测平均回弹值Rm数组
              var cgf = [];
              var hh = [];
              drawData.map((item) => {
                var len = item.data.length;
                var sum = 0;
                for (var i = 0; i < len; i++) {
                  var num = item.data[i] - 0;
                  sum += num;
                }
                angleNum.push(sum / len);
                anglerealNum.push(sum / len);
                cgf.push((sum / len).toFixed(1));
                hh.push((sum / len).toFixed(1));
              });
              anglerealNum.map((items, index) => {
                var num = "fResult" + (index + 1);
                if (!isNaN(items)) {
                  console.log(555, table[1][num], this.formData.fSurface);

                  this.formData.checkConcretesampleresult[0][num] =
                    items.toFixed(1);

                  if (table[1][num] == "" && this.formData.fSurface == "侧面") {
                    table[1][num] = "0°";
                    data[index].fDetectionangle = "0°";
                  } else if (
                    table[1][num] == "" &&
                    (this.formData.fSurface == "表面" ||
                      this.formData.fSurface == "底面")
                  ) {
                    table[1][num] = "90°";
                    data[index].fDetectionangle = "90°";
                  }
                } else {
                  this.formData.checkConcretesampleresult[0][num] = "";
                  this.formData.checkConcretesampleresult[1][num] = "";
                  this.formData.checkConcretesampleresult[2][num] = "";
                  this.formData.checkConcretesampleresult[3][num] = "";
                  this.formData.checkConcretesampleresult[4][num] = "";
                  this.formData.checkConcretesampleresult[5][num] = "";
                  this.formData.checkConcretesampleresult[6][num] = "";
                  this.formData.checkConcretesampleresult[7][num] = "";

                  table[1][num] = "";
                  data[index].fDetectionangle = "";
                }
              });
              this.formData.checkConcretesampleresult = table;
              this.RmData = anglerealNum; //实测平均回弹值Rm

              this.calculationData(
                this.RmData,
                this.formData.checkConcretesampleresult
              );
            } else {
              return this.$message.error(res.msg);
            }
          })
          .catch(() => {
            return false;
          });
      } else {
        return this.$message.error("请先选择需要查看的数据");
      }
    },
    calculationData(RmData, data) {
      var numData = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
      if (this.formData.fDirection == "非水平方向") {
        // 二、检测角度回弹值修正值
        var angleData = []; //所有角度，未填按'''
        numData.map((item, index) => {
          var num = "fResult" + (index + 1);

          angleData.push(data[1][num]);
        });

        // 遍历angleData,得到对应index
        var angleNumBer = [];
        for (var i = 0; i < angleData.length; i++) {
          if (angleData[i] == "90°") {
            angleNumBer.push("0");
          } else if (angleData[i] == "60°") {
            angleNumBer.push("1");
          } else if (angleData[i] == "45°") {
            angleNumBer.push("2");
          } else if (angleData[i] == "30°") {
            angleNumBer.push("3");
          } else if (angleData[i] == "-30°") {
            angleNumBer.push("4");
          } else if (angleData[i] == "-45°") {
            angleNumBer.push("5");
          } else if (angleData[i] == "-60°") {
            angleNumBer.push("6");
          } else if (angleData[i] == "-90°") {
            angleNumBer.push("7");
          } else if (angleData[i] == "") {
            angleNumBer.push("");
          }
        }
        // 处理实测平均回弹值Rm值
        // 大于等于20，小于等于50
        var angleList = [];
        var dc = [];
        for (var ii = 0; ii < RmData.length; ii++) {
          if (RmData[ii] < 20) {
            dc[ii] = 20;
          } else if (RmData[i] > 50) {
            dc[ii] = 50;
          } else if (RmData[i] == "") {
            dc[ii] = "";
          } else {
            dc[ii] = RmData[ii].toFixed(0);
          }

          // 对应平均回弹值的所有检测角度
          angleList.push({
            data: this.detectionList[dc[ii]],
          });
        }

        // 根据对应的角度对应值及实测平均回弹值找检测角度回弹值修正值
        var corrected = []; //检测角度回弹值修正值

        for (var j = 0; j < angleList.length; j++) {
          var ff;
          if (angleList[j].data != undefined) {
            for (var ih = 0; ih < angleList[j].data.length; ih++) {
              ff = angleList[j].data;
            }
            corrected.push(ff[angleNumBer[j]]);
          } else {
            corrected.push("");
          }
        }
        // 将检测角度回弹值修正值插入this.formData.checkConcretesampleresult数组
        corrected.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (item != "") {
            this.formData.checkConcretesampleresult[2][num] = item;
          }
        });
        // 检测角度回弹值修正值
        // 三、检测角度修正后回弹值
        var reviseAngleNum = [];
        RmData.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (!isNaN(item)) {
            reviseAngleNum.push(item - 0 + (corrected[i] - 0));
            this.formData.checkConcretesampleresult[3][num] = (
              item -
              0 +
              (corrected[i] - 0)
            ).toFixed(1);
          } else {
            reviseAngleNum.push("");
          }
        });

        // 检测角度修正后回弹值
        //  四、浇筑面回弹值修正值
        var PouringSurfaceFalg;
        if (this.formData.fSurface == "表面") {
          PouringSurfaceFalg = 0;
        } else {
          PouringSurfaceFalg = 1;
        }
        var reviseAngleNums = [];
        var PouringSurfaceList = [];
        for (var iv = 0; iv < reviseAngleNum.length; iv++) {
          if (reviseAngleNum[iv] != "") {
            if (reviseAngleNum[iv] < 20) {
              reviseAngleNums[iv] = 20;
            } else if (reviseAngleNum[iv] > 50) {
              reviseAngleNums[iv] = 50;
            } else {
              reviseAngleNums[iv] = (reviseAngleNum[iv] - 0).toFixed(0);
            }
          } else {
            reviseAngleNums[iv] = "";
          }
          // 对应检测角度修正后回弹值的浇筑面回弹值修正值
          PouringSurfaceList.push({
            data: this.surfaceList[reviseAngleNums[iv]],
          });
        }

        var PouringSurface = []; //检测角度回弹值修正值
        for (var jj = 0; jj < PouringSurfaceList.length; jj++) {
          var ll;
          if (PouringSurfaceList[jj].data != undefined) {
            for (var iu = 0; iu < PouringSurfaceList[jj].data.length; iu++) {
              ll = PouringSurfaceList[jj].data;
            }
            PouringSurface.push(ll[PouringSurfaceFalg]);
          } else {
            PouringSurface.push("");
          }
        }
        // 将浇筑面回弹值修正值插入this.formData.checkConcretesampleresult数组
        PouringSurface.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (item != "") {
            this.formData.checkConcretesampleresult[4][num] = item;
          }
        });
        // 浇筑面回弹值修正值
        // 五、修正后回弹平均值
        var modifiedMean = [];
        reviseAngleNum.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (item != "") {
            modifiedMean.push((item - 0 + (PouringSurface[i] - 0)).toFixed(1));
            this.formData.checkConcretesampleresult[5][num] = (
              item -
              0 +
              (PouringSurface[i] - 0)
            ).toFixed(1);
          } else {
            this.formData.checkConcretesampleresult[5][num] = "";
            modifiedMean.push("");
          }
        });
        // 五、修正后回弹平均值
        // 浇筑面回弹值修正值
      } else if (this.formData.fDirection == "水平方向") {
        RmData.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (!isNaN(item)) {
            this.formData.checkConcretesampleresult[5][num] = item.toFixed(1);
          }
          this.formData.checkConcretesampleresult[2][num] = "";
          this.formData.checkConcretesampleresult[3][num] = "";
          this.formData.checkConcretesampleresult[4][num] = "";
        });
      }

      // 六、碳化深度dm(mm)
      // 六、碳化深度dm(mm)

      //七 强度换算值(MPa)
      var Carbonizationdepth = [];
      numData.map((item, i) => {
        var num = "fResult" + (i + 1);
        Carbonizationdepth.push(data[6][num]);
      });

      var reallCarbonizationdepth = [];
      var reallCarbonizationv = [];
      RmData.map((item, index) => {
        //获取有实测平均回弹值Rm，且碳化深度dm(mm)不为空的数据
        if (!isNaN(item)) {
          reallCarbonizationdepth.push(Carbonizationdepth[index]);
          reallCarbonizationv.push(Carbonizationdepth[index]);
        } else {
          reallCarbonizationdepth.push("");
        }
      });

      var carbonationDepthNumBer = [];
      for (var ir = 0; ir < reallCarbonizationdepth.length; ir++) {
        if (reallCarbonizationdepth[ir] == "0.0") {
          carbonationDepthNumBer.push("0");
        } else if (reallCarbonizationdepth[ir] == "0.5") {
          carbonationDepthNumBer.push("1");
        } else if (reallCarbonizationdepth[ir] == "1.0") {
          carbonationDepthNumBer.push("2");
        } else if (reallCarbonizationdepth[ir] == "1.5") {
          carbonationDepthNumBer.push("3");
        } else if (reallCarbonizationdepth[ir] == "2.0") {
          carbonationDepthNumBer.push("4");
        } else if (reallCarbonizationdepth[ir] == "2.5") {
          carbonationDepthNumBer.push("5");
        } else if (reallCarbonizationdepth[ir] == "3.0") {
          carbonationDepthNumBer.push("6");
        } else if (reallCarbonizationdepth[ir] == "3.5") {
          carbonationDepthNumBer.push("7");
        } else if (reallCarbonizationdepth[ir] == "4.0") {
          carbonationDepthNumBer.push("8");
        } else if (reallCarbonizationdepth[ir] == "4.5") {
          carbonationDepthNumBer.push("9");
        } else if (reallCarbonizationdepth[ir] == "5.0") {
          carbonationDepthNumBer.push("10");
        } else if (reallCarbonizationdepth[ir] == "5.5") {
          carbonationDepthNumBer.push("11");
        } else if (reallCarbonizationdepth[ir] == "≥6.0") {
          carbonationDepthNumBer.push("12");
        } else if (reallCarbonizationdepth[ir] == "") {
          carbonationDepthNumBer.push("");
        }
      }

      // 判断测区强度换算表，
      var AverageArr = []; //修正后回弹平均值
      numData.map((item, i) => {
        var num = "fResult" + (i + 1);
        AverageArr.push(this.formData.checkConcretesampleresult[5][num]);
      });

      var newAverageArr = []; //修正后回弹平均值(修正值自我)
      var correctedAveraged = []; //强度换算值(MPa)数组
      var correctedAveragedData = [];
      if (this.formData.fConcretetype == "泵送混凝土") {
        // 大于等于18.6，小于等于52.8
        var correctedAverageList = [];
        for (var id = 0; id < AverageArr.length; id++) {
          if (AverageArr[id] != "") {
            if (AverageArr[id] - 0 < 18.6) {
              newAverageArr[id] = 18.6;
            } else if (AverageArr[id] - 0 > 52.8) {
              newAverageArr[id] = 52.8;
            } else {
              newAverageArr[id] = (AverageArr[id] - 0).toFixed(1);
            }
          } else {
            newAverageArr[id] = "";
          }
          // 对应平均回弹值的所有换算强度
          correctedAverageList.push({
            data: this.concretetypeList[newAverageArr[id]],
          });
        }
        for (var jb = 0; jb < correctedAverageList.length; jb++) {
          var vf;
          if (correctedAverageList[jb].data != undefined) {
            for (var ik = 0; ik < correctedAverageList[jb].data.length; ik++) {
              vf = correctedAverageList[jb].data;
            }
            if (vf[carbonationDepthNumBer[jb]] != undefined) {
              correctedAveraged.push(vf[carbonationDepthNumBer[jb]]);
              correctedAveragedData.push(vf[carbonationDepthNumBer[jb]]);
            } else {
              correctedAveraged.push("");
              correctedAveragedData.push("");
            }
          } else {
            correctedAveraged.push("");
            correctedAveragedData.push("");
          }
        }
        correctedAveraged.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (item != "") {
            this.formData.checkConcretesampleresult[7][num] = item;
          }
        });

        // console.log(8888899999, this.formData.checkConcretesampleresult[7]);
      } else if (this.formData.fConcretetype == "非泵送混凝土") {
        // 大于等于20.0，小于等于50.0
        var correctedAverageLists = [];
        for (var ids = 0; ids < AverageArr.length; ids++) {
          if (AverageArr[ids] != "") {
            if (AverageArr[ids] < 20.0) {
              newAverageArr[ids] = "20.0";
            } else if (AverageArr[ids] > 50.0) {
              newAverageArr[ids] = "50.0";
            } else {
              newAverageArr[ids] = AverageArr[ids];
            }
          } else {
            newAverageArr[ids] = "";
          }
          correctedAverageLists.push({
            data: this.concretetypeunList[newAverageArr[ids]],
          });
        }

        for (var jr = 0; jr < correctedAverageLists.length; jr++) {
          var vfs;
          if (correctedAverageLists[jr].data != undefined) {
            for (var io = 0; io < correctedAverageLists[jr].data.length; io++) {
              vfs = correctedAverageLists[jr].data;
            }
            if (vfs[carbonationDepthNumBer[jr]] != undefined) {
              correctedAveraged.push(vfs[carbonationDepthNumBer[jr]]);
              correctedAveragedData.push(vfs[carbonationDepthNumBer[jr]]);
            } else {
              correctedAveraged.push("");
              correctedAveragedData.push("");
            }
          } else {
            correctedAveraged.push("");
            correctedAveragedData.push("");
          }
        }
        correctedAveraged.map((item, i) => {
          var num = "fResult" + (i + 1);
          if (item != "") {
            this.formData.checkConcretesampleresult[7][num] = item;
          }
        });
      }
      // this.formData.checkConcretesampleresult.map()
      // 强度换算值(MPa)
      // 碳化深度dm(mm)

      var correctedAveragedNum = []; //处理强度换算值
      for (var ig = 0; ig < correctedAveragedData.length; ig++) {
        // /\D/g
        var str = correctedAveragedData[ig].replace(/[^\d.]/gi, "");
        correctedAveragedNum.push(str);
      }
      var qdhsz = [];
      // 强度换算值剔除空，>60和<10
      correctedAveragedData.map((item) => {
        if (item != ">60" && item != "<10") {
          qdhsz.push(item);
        }
      });
      // var correctedAveragedNumber = 0;
      // for (i = 0; i < correctedAveragedNum.length; i++) {
      //   var num = correctedAveragedNum[i];

      //   correctedAveragedNumber += num - 0;
      // }
      var correctedAveragedNumber = 0;
      for (i = 0; i < qdhsz.length; i++) {
        var num = qdhsz[i];

        correctedAveragedNumber += num - 0;
      }
      var correctedGetData = [];
      qdhsz.map((item) => {
        if (item != "") {
          correctedGetData.push(item);
        }
      });
      var strengthConversionAverage; // 强度换算值平均值
      if (correctedGetData.length != 0) {
        strengthConversionAverage =
          correctedAveragedNumber / correctedGetData.length; // 强度换算值平均值
      } else {
        strengthConversionAverage = 0;
      }
      //  强度换算值方差
      var strengthConversionNum = 0;
      // 强度换算值减去强度换算值平均值 的平方

      for (var ie = 0; ie < correctedGetData.length; ie++) {
        if (correctedGetData[ie] != "") {
          strengthConversionNum += Math.pow(
            correctedGetData[ie] - 0 - strengthConversionAverage.toFixed(2),
            2
          );
        }
      }

      const filtered = reallCarbonizationv.filter((item) => {
        return item !== null && typeof item !== "undefined" && item !== "";
      });

      if (filtered.length != 0) {
        //碳化深度dm(mm)数组不为空时
        var strengthAveraged = 0;
        if (correctedGetData.length != 0 && correctedGetData.length != 1) {
          strengthAveraged =
            strengthConversionNum / (correctedGetData.length - 1);
        }

        var strengthAveragedNum = Math.sqrt(strengthAveraged);
        this.formData.fStandarddeviation = strengthAveragedNum.toFixed(2);
        //  强度换算值方差

        // 混凝土强度推定值(MPa)
        var powerHsz = [];
        // 强度换算值剔除空
        correctedAveragedData.map((item) => {
          if (item != "") {
            powerHsz.push(item);
          }
        });
        var one = correctedGetData[0];
        for (var ifn = 1; ifn < correctedGetData.length; ifn++) {
          one = Math.min(one, correctedGetData[ifn]);
        }
        var max=0;
        powerHsz.map((item) => {
          if (this.formData.fTestnum - 0 < 10) {
            this.formData.fConcreteresult = one + "Mpa";
          } else {
            this.formData.fConcreteresult =
              (
                strengthConversionAverage -
                this.formData.fStandarddeviation * 1.645
              ).toFixed(1) + "Mpa";
          }
          if (item == "<10") {
            this.formData.fConcreteresult = "<10.0Mpa"; //当构件的测区强度值中有小于10.0MPa时
          } else if (item == ">60") {
            max++;
          
            if(max==powerHsz.length){
              this.formData.fConcreteresult =">60.0Mpa";
            }else {
              this.formData.fConcreteresult = one + "Mpa";
            }
            if(powerHsz.length==1){
              this.formData.fConcreteresult =">60.0Mpa";
            }
          } else if (
            item != "<10" &&
            item < "10" &&
            item != ">60" &&
            item < "10"
          ) {
            this.formData.fConcreteresult = "<10.0Mpa";
          }
        });
        // if (this.formData.fTestnum - 0 < 10) {
          
        //   this.formData.fConcreteresult = correctedGetData[0];
        //   for (var ifn = 1; ifn < correctedGetData.length; ifn++) {
        //     this.formData.fConcreteresult = Math.min(
        //       this.formData.fConcreteresult,
        //       correctedGetData[ifn]
        //     );
        //   }
        //   this.formData.fConcreteresult = this.formData.fConcreteresult + "Mpa";
        // } else if (this.formData.fTestnum - 0 >= 10) {
        //   //当构件测区不少于10个时
        //   this.formData.fConcreteresult =
        //     (
        //       strengthConversionAverage -
        //       this.formData.fStandarddeviation * 1.645
        //     ).toFixed(1) + "Mpa";
        // }


        // 
        for (var ia = 0; ia < correctedAveragedData.length; ia++) {
          // if (correctedGetData[ia] - 0 < 10.0) {
          //   this.formData.fConcreteresult = "<10.0Mpa"; //当构件的测区强度值中有小于10.0MPa时
          // }


          if (this.formData.fTestresult == null) {
            this.formData.fTestresult =
              "经检测，该结构物回弹强度推定值" +
              this.formData.fConcreteresult +
              "。";
          } else {
            this.formData.fTestresult =
              "经检测，该检测结果符合（判定依据）技术要求。";
          }

          // 混凝土强度推定值(MPa)
        }
      }
      if (this.formData.fModifydate == null) {
        this.submitFormSample(this.formData);
      }
    },
    submitFormSample(data) {
      saveConcreteChecksample(data).then((res) => {
        if (res.errcode == 0) {
          console.log("保存成功");
        } else {
          this.$message.error(res.msg);
        }
      });
    },
    // 左侧树结构
    getTree() {
      this.treeText.companyId = this.userInfo.companyId;
      this.treeText.userId = this.userInfo.userId;
      getUserCompanyTreeList(this.treeText)
        .then((res) => {
          if (res.errcode == 0) {
            var companyTree = res.data.userCompanyTreeList;
            this.treeData = this.commonJs.tranListToTreeData(companyTree);

            if (this.treeData[0].children == undefined) {
              this.treelength = false;
            } else {
              this.treelength = true;
            }
            if (this.checkData[0]) {
              this.name = JSON.parse(
                sessionStorage.getItem("engineerList")
              ).fShortname;
              this.companyId = this.checkData[0];
              this.getList.fCompanyid = this.checkData[0];
            } else {
              this.name = this.treeData[0].fShortname; //当前点击组织机构名称
              this.getList.fCompanyid = this.treeData[0].fCompanyid; //当前点击组织机构ID
              this.companyId = this.treeData[0].fCompanyid;
              this.checkData[0] = this.treeData[0].fCompanyid;
            }

            // this.companyId = this.treeData[0].fCompanyid;
            // this.name = this.treeData[0].fShortname;
            // 列表
            // this.getList.fCompanyid = this.treeData[0].fCompanyid;
            // console.log(this.getList.fCompanyid);
            this.getDataList(this.getList);
            // 列表
          } else {
            this.$message.error(res.msg);

            return false;
          }
        })
        .catch(() => {
          return false;
        });
    },

    // 获取列表数据
    getDataList(data) {
      this.loading = true;
      var that = this;
      getConcreteChecksamplePageList(data)
        .then((res) => {
          if (res.errcode == 0) {
            that.loading = false;
            that.tableData = res.data.checkConcretesampleList.list;

            this.queryCriteriaData = res.data.checkConcretesampleList;
            this.navigatepageNums =
              this.queryCriteriaData.navigatepageNums.length;
            // setTimeout(() => {
            //   that.$nextTick(() => {
            //     that.$refs.multipleTable.doLayout();
            //   });
            // }, 200);
          } else {
            this.loading = false;
            this.$message.error(res.msg);
          }
        })
        .catch((err) => {
          console.log(err);
        });
      // const { data: res } = await this.$http.post(
      //   "roadApi/getConcreteList.do",
      //   {
      //     companyId: id,
      //   }
      // );
    },

    // 点击当前行
    getRowInfo(e) {
      this.equipmentDetailId = e.fId;
      // console.log(e);
      // this.fId = e.fId;
    },
    // 改变当前行背景色   :row-style="rowStyle"
    rowStyle({ row }) {
      if (this.currentRowId === row.F_Id) {
        // 此处返回选中行的样式对象，按需设置
        return {
          "background-color": "rgb(94, 180, 251) !important",
          //  "background-color": "#f5f9fd",
          color: "rgb(255, 255, 255) !important",
        };
      }
    },

    // 打印表
    printFile(num) {
      if (this.fId != null && this.fId != "") {
        // App/upload/getExcelByConcreteSample.do
        if (num == 0) {
          window.open(
            this.$url + "App/upload/getExcelByConcreteSample.do?fId=" + this.fId
          );
        } else if (num == 1) {
          window.open(
            this.$url +
            "App/upload/getExcelByConcreteSampleCode.do?fId=" +
            this.fId
          );
          // window.open(
          //   "http://1.14.19.236:8047/concreteScreen/App/upload/getExcelByConcreteSampleCode.do?fId=" +
          //     this.fId
          // );
        }
      } else {
        this.$message({
          message: "您没有选中任何数据项,请选中后再操作！",
          type: "warning",
        });
      }
    },

    // 获取页面容器高度
    getHeight() {
      var h = document.documentElement.clientHeight; //获取页面可见高度
      // var w = document.documentElement.clientWidth; //获取页面可见高度
      this.dialogHeight = h * 0.75 + "px";
      this.dialogHeights = h * 0.888 + "px";
    },
    handleNodeClick(data) {
      if (this.checked == true) {
        this.getList.sublevel = 1;
      } else {
        this.getList.sublevel = 0;
      }
      this.name = data.fShortname;
      this.getList.fCompanyid = data.fCompanyid;
      this.getDataList(this.getList);
    },
    handleClick(row, num) {
      this.fId = row.F_Id;
      this.printFile(num);
    },
    // 点击报告编码
    // openDialog(row) {

    //   this.equipmentDetailId = row.fId
    //   this.edit(1)
    // },
    openDialog(row, num) {
      if (num == 1) {
        this.equipmentDetailId = row.fId;
        this.thedHederShow = true;
        this.activeIndex = "1";
      } else if (num == 2) {
        this.equipmentDetailId = row.fId;
        this.thedHederShow = false;
        this.activeIndex = "1";
      } else if (num == 3) {
        this.equipmentDetailId = row.fId;
        this.thedHederShow = false;
        this.activeIndex = "2";
      } else if (num == 4) {
        this.equipmentDetailId = row;
        this.thedHederShow = true;
        this.activeIndex = "1";
      }
      this.edit(num);
    },
    handleSelect(key) {
      this.activeIndex = key;
    },
  },
};
</script>

<style scoped>
.printTables {
  background: #fff;
  display: flex;
  justify-content: end;
  padding: 5px;
  margin-top: 10px;
}

a {
  text-decoration: none;
  color: #000;
}

.dialogBody {
  padding: 3px 20px;
  height: 80%;
  overflow-y: auto;
}

.pageFlagText {
  color: #171a1d;
  font-size: 16px;
}
</style>